<%@include file="/header.jsp" %>

<%
    String errors[] = {
        "",
        "Enter email and password",
        "Wrong email or password",
        "Account is not activated",
        "Accound is locked"
    };
    Object error_num = request.getAttribute("error");
    String errorf = "";
    if (error_num != null) {
        int error_n = ((Integer) error_num).intValue();
        if (error_n > 0 && error_n < errors.length) {
            errorf = errors[error_n];
        }
    }
%>

    <h2 class="content_title">Login</h2>
    <table class="white_block">
        <thead>
            <tr>
                <th>
                    <h2>Authentication data</h2>
                </th>
                <th>
                    <h2>Create account</h2>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td style="width: 50%;">
                    <table width="50">
                        <tbody>

                            <tr>
                                <td>
                                    <span class="error_msg"><%= errorf %></span>
                                    <form method="post">
                                        E-mail <input type="email" name="email" size="50"><br>
                                        Password <input type="password" name="password" size="50"><br>
                                        <br>
                                        <input style="float: right;" type="submit" value="Login">
                                    </form>

                                </td>
                            </tr>

                        </tbody>
                    </table>
                </td>
                <td style="width: 50%;">
                    If you do not have an account on our web site please register. 
                    <a href="${pageContext.request.contextPath}/signup">Go to registration page.</a> 
                </td>
            </tr>
        </tbody>
    </table> 

<%@include file="/footer.jsp" %>
